<?php

/**
 * 
 * @author NutMotion <simonotm.linux@gmail.com> 
 */
function showError($file, $function, $msg) {
    echo buildHtmlPresentationForError($file, $function, $msg);
//    echo "<div style='border:1px solid red; background-color: grey'>";
//    echo "Sorry! an error occured in function <span style='font-weight:bold' />$function</span> from file $file.<br />";
//    echo "<span style='font-decoration:underline' />Details</span> : $msg";
//    echo "</div>";
}

function buildHtmlPresentationForError($file, $function, $msg) {
    $htmlString = "<div style='border:1px solid red;'>"
            . "Sorry! an error occured in function <span style='font-weight:bold' />$function</span> from file $file.<br />"
            . "<span style='font-decoration:underline' />Details</span> : $msg"
            . "</div>";
    
    return $htmlString;
}

function buildJSONErrorString($request) {
    return "Received the following parameters from an ajax call:".htmlentities(print_r($request,true).".");
//        return "Received the following parameters from an ajax call:";

}

?>
